"""
题目一：需求编程
"""

class Student(object):
    def __init__(self, id,name,age,sex,height,wight,score,address,phone):
        """定义了一个学生类：属性:学号，姓名，年龄，性别，身高，体重，成绩，家庭地址，电话号码。"""
        self.id = id
        self.name = name
        self.age = age
        self.sex=sex
        self.height = height
        self.wight = wight
        self.score = score
        self.address = address
        self.phone = phone

    def study(self,time):
        """学习（要求参数传入学习的时间）"""
        print('{}在{}时刻学习'.format(self.name,time))

    def play_game(self,game):
        """玩游戏（要求参数传入游戏名）"""
        print('{}在玩游戏-{}'.format(self.name,game))

    def programming(self,rows):
        """编程（要求参数传入写代码的行数）"""
        print('{}编写了{}行代码'.format(self.name,rows))

    def sum_number(self,*args,**kwargs):
        """数的求和（要求参数用变长参数来做，返回求和结果）"""
        return sum(args)

class Car(object):
    def __init__(self,name,wheels=4,color='white',wight=5,oil=100):
        """车类：属性：车型号，车轮数，车身颜色，车重量，油箱存储大小 。"""
        self.name = name
        self.wheels = wheels
        self.color = color
        self.wight = wight
        self.oil = oil
    def run(self,function):
        """跑（要求参数传入车的具体功能，比如越野，赛车）"""
        print('{}在{}'.format(self.name,function))

class laptop(object):
    def __init__(self,name,endurance,color,wight,cpu,memory,disk):
        """笔记本：属性：型号，待机时间，颜色，重量，cpu型号，内存大小，硬盘大小。  """
        self.name = name
        self.endurance = endurance
        self.color = color
        self.wight = wight
        self.cpu = cpu
        self.memory = memory
        self.disk = disk
    def play(self,game_name):
        """打游戏（传入游戏的名称）"""
        print('{}可以玩游戏：{}'.format(self.name,game_name))
    def work(self):
        """办公"""
        print('{}可以办公'.format(self.name))

class monkey(object):
    def __init__(self,kind,sex,color,wight):
        """猴子类：属性：类别，性别，身体颜色，体重。"""
        self.kind = kind
        self.sex=sex
        self.color = color
        self.wight = wight
    def make_fire(self,material):
        """造火（要求传入造火的材料：比如木棍还是石头）"""
        print('{}种类的猴子使用{}造火'.format(self.kind,material))
    def study_sth(self,*args):
        """学习事物（要求参数传入学习的具体事物，可以不止学习一种事物）"""
        print('{}种类的猴子学会了{}'.format(self.kind,' '.join(args)))

if __name__ == '__main__':
    # 创建：法拉利，宝马，铃木，五菱，拖拉机对象
    Ferrari, BMW, Suzuki, Wuling, tractor=Car('Ferrari'),Car('BMW'),Car('Suzuki'),Car('Wuling'),Car('tractor')
    Ferrari.run('开门')
    BMW.run('下车')
    Suzuki.run('下车')
    Wuling.run('加速')
    tractor.run('减速')
